package com.kolaxy.social.govern.report.mapper;

import com.kolaxy.social.govern.report.domain.ReportTask;
import org.apache.ibatis.annotations.*;

/**
 * @Description TODO
 * @Author zrj
 * @Date 2020/9/2 19:15
 * @Version 1.0
 */
@Mapper
public interface ReportTaskMapper {

    @Insert("insert into report_task(type, reprot_user_id, report_content, target_id)" +
            " values(#{type},#{reportUserId},#{reportContent},#{targetId},)")
    void insert(ReportTask reportTask);

    @Select("select id , type, report_user_id, report_content, target_id from report_task where id = #{id}")
    @Results(
            {@Result(column = "id", property = "id", id = true),
                    @Result(column = "type", property = "type"),
                    @Result(column = "report_user_id", property = "reportUserId"),
                    @Result(column = "report_content", property = "reportContent"),
                    @Result(column = "target_id", property = "targetId")
            })
    ReportTask selectById(Long id);

    @Update("update report_task set vote_result = #{voteResult} where id = #{id}")
    void update(ReportTask reportTask);
}
